<template>
  <u-popup class="form-popup" mode="bottom" :show="show" v-if="carInfo">
    <view style="width: 100%; height: 100vh; overflow-y: scroll">
      <div class="basic-style">
        <div class="basic-title basic-border">基本信息</div>
        <u-form-item disabled label="单据编号" prop="documentNo">
          <u--input placeholder="请输入单据编号" v-model="carInfo.documentNo" disabled></u--input>
        </u-form-item>
        <u-form-item label="录入人" prop="createBy">
          <u--input disabled placeholder="请输入录入人" v-model="carInfo.createBy"></u--input>
        </u-form-item>
        <u-form-item label="创建日期" prop="createTime">
          <u--input disabled placeholder="请输入创建日期" v-model="carInfo.createTime"></u--input>
        </u-form-item>
        <u-form-item label="所属单位" prop="affiliatedUnit">
          <h-select-company-input-popup
            disabled
            style="width: 100%"
            v-model="carInfo.affiliatedUnit"
            commercialType="1"
            placeholder="请选择所属单位"
          ></h-select-company-input-popup>
        </u-form-item>
        <u-form-item label="所属团队" prop="teamId">
          <h-select-team-input
            disabled
            style="width: 100%"
            v-model="carInfo.teamId"
            objectField="carInfo.teamId"
            placeholder="请选择所属团队"
            :tdlx="3"
          />
        </u-form-item>
        <u-form-item label="车辆名称" prop="carName">
          <u--input disabled placeholder="请输入车辆名称" v-model="carInfo.carName"></u--input>
        </u-form-item>
        <u-form-item label="车牌" prop="carNum">
          <u--input disabled placeholder="请输入车牌" v-model="carInfo.carNum"></u--input>
        </u-form-item>
        <u-form-item label="车辆类型" prop="carType">
          <h-select-input-tag
            disabled
            class="w-100"
            v-model="carInfo.carType"
            objectField="carInfo.carType"
            placeholder="请选择车辆类型"
            dictName="car_type_oa"
          ></h-select-input-tag>
        </u-form-item>
        <u-form-item label="座位数" prop="carSeatNum">
          <h-select-input-tag
            disabled
            v-if="!carInfo.carType"
            class="w-100"
            v-model="carInfo.carSeatNum"
            objectField="carInfo.carSeatNum"
            placeholder="请选择座位数"
            dictName="car_seat_num"
          ></h-select-input-tag>
          <h-select-input-tag
            disabled
            v-if="carInfo.carType == '1'"
            class="w-100"
            v-model="carInfo.carSeatNum"
            objectField="carInfo.carSeatNum"
            placeholder="请选择座位数"
            dictName="car_seat_num_carriage"
          ></h-select-input-tag>
          <h-select-input-tag
            disabled
            v-if="carInfo.carType == '2'"
            class="w-100"
            v-model="carInfo.carSeatNum"
            objectField="carInfo.carSeatNum"
            placeholder="请选择座位数"
            dictName="car_seat_num_mpv"
          ></h-select-input-tag>
          <h-select-input-tag
            disabled
            v-if="carInfo.carType == '3'"
            class="w-100"
            v-model="carInfo.carSeatNum"
            objectField="carInfo.carSeatNum"
            placeholder="请选择座位数"
            dictName="car_seat_num_van"
          ></h-select-input-tag>
        </u-form-item>
        <u-form-item label="购置日期" prop="purchaseTime">
          <h-time-select
            disabled
            mode="datetime"
            v-model="carInfo.purchaseTime"
            placeholder="请选择购置日期"
            suffixIcon="calendar-fill"
            :suffixIconStyle="{ color: '#B2B2B2' }"
          ></h-time-select>
        </u-form-item>
        <u-form-item label="车辆状态" prop="carState">
          <h-select-input-tag
            disabled
            class="w-100"
            v-model="carInfo.carState"
            objectField="carInfo.carState"
            placeholder="请选择车辆状态"
            dictName="car_state"
          ></h-select-input-tag>
        </u-form-item>
        <u-form-item label="初次购买保险时间" prop="firstBuyInsuranceTime">
          <h-time-select
            disabled
            mode="datetime"
            v-model="carInfo.firstBuyInsuranceTime"
            placeholder="请选择初次购买保险时间"
            suffixIcon="calendar-fill"
            :suffixIconStyle="{ color: '#B2B2B2' }"
          ></h-time-select>
        </u-form-item>
        <u-form-item label="保险到期时间" prop="insuranceEndTime">
          <h-time-select
            disabled
            mode="datetime"
            v-model="carInfo.insuranceEndTime"
            placeholder="请选择保险到期时间"
            suffixIcon="calendar-fill"
            :suffixIconStyle="{ color: '#B2B2B2' }"
          ></h-time-select>
        </u-form-item>
        <u-form-item label="车辆管理员" prop="carAdmin">
          <h-select-person-input-popup
            disabled
            v-model="carInfo.carAdmin"
            style="width: 100%"
            placeholder="请选择车辆管理员"
            searchPlaceholder="请输入"
            suffixIcon="arrow-down-fill"
            :suffixIconStyle="{ color: '#B2B2B2' }"
          ></h-select-person-input-popup>
        </u-form-item>
      </div>

      <div class="basic-style">
        <div class="basic-title basic-border">租赁信息</div>
        <u-form-item label="是否外带" prop="leaseType">
          <h-select-input-tag
            disabled
            class="w-100"
            v-model="carInfo.leaseType"
            objectField="carInfo.leaseType"
            placeholder="请选择是否外带"
            dictName="lease_type"
          ></h-select-input-tag>
        </u-form-item>
        <u-form-item label="租金（元）" prop="rent">
          <u--input disabled placeholder="请输入租金（元）" v-model="carInfo.rent"></u--input>
        </u-form-item>
        <u-form-item label="备注" prop="remark">
          <u--textarea disabled confirm-type="send" v-model="carInfo.remark" placeholder="请输入备注"></u--textarea>
        </u-form-item>
      </div>

      <view class="basic-style">
        <view class="basic-title basic-border">附件信息</view>
        <view class="py-1 space-y-1" style="width: 100%">
          <view style="color: red">提示：附件信息</view>
          <file-list v-if="carInfo.fileInfo" v-model="carInfo.fileInfo" :isDelete="false"></file-list>
        </view>
      </view>
			<view class="space-x-1 px-1 btn_position">
			  <u-button @click="$emit('update:show', false)" type="primary">返回</u-button>
			</view>
    </view>
  </u-popup>
</template>

<script>
import fileList from '@/pages/synergy/components/fileList.vue'

export default {
  name: 'PopupCarInfo',
  components: { fileList },
  props: {
    show: {
      type: Boolean,
      default: false,
    },
    carInfo: {
      type: Object,
      default: () => {},
    },
  },
}
</script>

<style scoped lang="scss">
@import url('@/assets/inputStyle.scss');
.trip-form-data {
  ::v-deep {
    .u-form-item__body {
      padding-top: 2px;
      padding-bottom: 2px;
    }
  }
}
.checkbox-item {
  display: flex;
  align-items: center;
}
</style>
